package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsAdminMapper;
import com.qf.pojo.DtsAdmin;
import com.qf.vo.CatVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mkr
 * @version V1.0
 * @Project java2203-mkr
 * @Package com.qf.service
 * @Description:
 * @Date 2022/6/16 20:47
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private DtsAdminMapper adminMapper;

    @Override
    public List<DtsAdmin> findAdminByUserName(String userName) {
        //创建查询条件对象
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("username", userName);
        queryWrapper.eq("deleted", false);

        //查询并返回查询结果
        List<DtsAdmin> list = adminMapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public List<CatVo> findCatVoAdmin() {
     List<CatVo>  findCatVoAdmin =  adminMapper.findCatVoAdmin();
        return findCatVoAdmin;
    }
}
